package chat;
import langen.TemplateLanguageGenerator;

/**
 * A helper class to test the functionality of ChatBots, used in IJP assignment 1.
 * Runs a conversation between two chat bots for a specified number of 
 * conversational turns
 * you need to set each chatbot a language template to make them talkable
 * 
 * @author Judy Robertson
 */
public class Discussion {

	/**
	 * The ChatBot who will start the conversation 
	 */
	private ChatBot initiator;
	
	/**
	 * The ChatBot who will respond to the initiator
	 */
	private ChatBot responder;
	
	
	/**
	 * generate a language template s1 for bot initiator
	 */
	private langen.TemplateLanguageGenerator s1;
	
	/**
	 * generate a language template s2 for bot responder
	 */
	
	private langen.TemplateLanguageGenerator s2;
	
	/**
	 * Creates a Discssion between two ChatBots and makes them have a conversation
	 *
	 */
    
	public Discussion(){
	      s1=new langen.TemplateLanguageGenerator();//create a template
	      s2=new langen.TemplateLanguageGenerator();//create a template
	      initiator=new ChatBot("","");
	      responder=new ChatBot("","");
	      initiator.setLanguageGenerator(s1);//set chatbot using template
	      responder.setLanguageGenerator(s2);//set chatbot using template
	      
	    
	      String s=initiator.startConversation();//start a conversation
	      
	      /*
	       * generate a conversation
	       */
	      for(int i=0;i<=8;i++)
	      {
	          s=responder.reply(s);
	          s=initiator.reply(s);
	       }
	       
	       s=responder.reply(s);
		
		
		
	}

	
	
	/**
	 * Create a Discussion for testing functionality of the ChatBot class
     * 
	 * @param args command line arguments
	 */
	public static void main(String[] args) {
		Discussion s=new Discussion();
		
	}
	
}
